import Vue from 'vue'
import Vuex from 'vuex'
import {Session} from '../utils/sessions'
Vue.use(Vuex)
const store = new Vuex.Store(
  {
    state: {
      HJZT: '',
      XTXGJData: {},
      NowName: "",
      JFTZ: '',
      GJQY: '',
      DXS: "",
      toGuid: '',
      Edition: true,
      //误删 用于保存浙里办app中传入的适老化&&普通模式
      UIStyle: "",
      toGuid1: '',
      isGJ: true,
      dataContent: [],
      UUID: '',
      UUID1: '',
      params: {},
      CityName: '',
      routerDirection: '',
      division: {},
      tjlx:157,
      DXS:'',
      position:'',
      jianzhuGS:'',
      MyAgentSNew:'',
      MyAgentSNew1:'',
      navigations: Session.get('LINGGOU_NAVIGATIONS') || [],
      wgxxInfo: {},
      //选图集v2
      TJDATAV2:{},
      //存放选图集v2
      TJROWDATA:{},
      householdFileForm: {},
      SSQYItem: {},
      sendShow: false,
    },
    mutations: {
      // SAVE_securityMain(state, data){
      //   state.securityMainSearch = data;
      // },
      // SAVE_buildMain(state, data){
      //   state.securityMainSearch = data;
      // },
      // SAVE_HouseExamination(state, data){
      //   state.securityMainSearch = data;
      // },
      getVERSIONNUMBER(state, price) {
        state.VERSIONNUMBER = price;
      },
      getIsGJ(state, price) {
        state.isGJ = price;
      },
      getSendShow(state, price) {
        state.isGJ = price;
      },
      getTJROWDATA(state, price) {
        state.TJROWDATA = price;
      },
      getTJDATAV2(state, price){
        state.TJDATAV2 = price;
      },
      SAVE_POSITION(state, price) {
        state.position = price;
      },
      getjianzhuGS(state, price) {
        state.jianzhuGS = price;
      },
      getMyAgentSNew(state, price){
        state.MyAgentSNew = price;
      },
      getMyAgentSNew1(state, price){
        state.MyAgentSNew1 = price;
      },
      getIF_DXS(state, price) {
        state.DXS = price;
      },
      gettjlx(state, price) {
        state.tjlx = price;
      },
      getHJZT(state, price) {
        state.HJZT = price;
      },
      getXTXGJData(state, price) {
        state.XTXGJData = price;
      },
      getNowName(state, price) {
        state.NowName = price;
      },
      getJFTZ(state, price) {
        state.JFTZ = price;
      },
      getGJQY(state, price) {
        state.GJQY = price;
      },
      getDXS(state, price) {
        state.DXS = price
      },
      gettoGuid(state, price) {
        state.toGuid = price
      },
      gettoGuid1(state, price) {
        state.toGuid1 = price
      },
      getEdition(state, price) {
        state.Edition = price
      },
      SetUIStyle(state, price) {
        state.UIStyle = price
      },
      getContent(state, price) {
        state.dataContent = price
      },
      getUUID(state, price) {
        state.UUID = price
      },
      getParams(state, price) {
        state.params = price
      },
      getUUID1(state, price) {
        state.UUID1 = price
      },
      getCityName(state, price) {
        state.CityName = price
      },
      UPDATE_ROUTER_DIRECTION(state, payload) {
        state.routerDirection = payload.routerDirection
      },
      UPDATE_NAVIGATIONS(state, payload) {
        // state.navigations.push(payload.isLoading)
        // Session.set('LINGGOU_NAVIGATIONS', state.navigations)
      },
      UPDATE_LOADING_STATUS(state, payload) {
        state.navigations.push(payload.path)
        Session.set('LINGGOU_NAVIGATIONS', state.navigations)
      },
      DELETE_NAVIGATION(state, payload) {
        let index = payload.index
        state.navigations = state.navigations.slice(0, index + 1)
        Session.set('LINGGOU_NAVIGATIONS', state.navigations)
      },
      CLEAR_NAVIGATIONS(state, payload) {
        Session.clear()
        state.navigations = []
      },

    }
}
);
export default store
